﻿using System.Collections.Generic;
using Rework.CommerceHistory.Models;
using Nwazet.Commerce.Models;
using Orchard.Environment.Extensions;
using System;
using System.Web.Mvc;

namespace Rework.CommerceHistory.ViewModels {
    [OrchardFeature("Rework.CommerceRoleAssignment")]
    public class ProductRolesViewModel {
        public ProductRolesViewModel() {
            Roles = new List<ProductRoleEntry>();
        }

        public int ProductId { get; set; }
        //public IProductRoles ProductRoles { get; set; }
        public IList<ProductRoleEntry> Roles { get; set; }

        public int NumberOfPeriods { get; set; }
        public PeriodOptions PeriodType { get; set; }
        public IEnumerable<SelectListItem> PeriodTypes { get; set; }
    }

    [OrchardFeature("Rework.CommerceRoleAssignment")]
    public class ProductRoleEntry {
        public int RoleId { get; set; }
        public string Name { get; set; }
        public bool Granted { get; set; }
    }
}
